package com.jichangxiu.common.entity.bo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;

/**
 * SecurityPower:
 *
 * @author Jcx
 * @create 2023-04-03 21:49
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "系统安全权限")
public class SecurityPower implements GrantedAuthority {

    @Schema(description = "系统权限对象")
    private Record record;

    @Override
    @JsonIgnore
    public String getAuthority() {
        return record.getStr("powerCode");
    }

}
